package cate.game.role.pvp.guildwar.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBGuildWar;
import cate.game.pvp.guildwar.data.msg.GWGuildRankInnerResp;
import cate.game.role.res.guild.po.GuildPO;

@ClientMsg(title = "公会战 公会排行榜 の 请求")
public class GuildWarGuildRankReq implements MsgInput {

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GuildPO guild = cc.getRole().getRes().guild.getGuild();
        if (guild == null) {
            game.notice.message(cc.getRole(), "尚未加入公会");
            return;
        }
        GWGuildRankInnerResp resp = game.pvp.guildWar.getMessagingModule().getGuildRank(guild.uid);
        cc.getRole().sendNow(new GuildWarGuildRankResp(resp.list,resp.myRank,resp.my));
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBGuildWar.GUILD_RANK_REQ;
    }
}
